import { writeFileSync } from "fs";

export default function versionPlugin() {
  return {
    name: "version-plugin",
    writeBundle() {
      const version = Date.now(); // 使用时间戳作为版本号
      const content = `{"version": "${version}"}`;
      writeFileSync("public/version.json", content);
    },
  };
}
